package com.esm.controller;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.esm.model.Department;
import com.esm.service.SelectDeptService;
import com.esm.serviceimpl.SelectDeptServiceImpl;

/**
 * 查询部门种类
 * @author 康少
 *
 * 2017年1月6日
 */
public class SelectDepartmentController extends HttpServlet{
	SelectDeptService selectdept = new SelectDeptServiceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doPost(req, resp);
	}
	
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		// TODO Auto-generated method stub
		List<Department> depts = selectdept.getDeptName();
		HttpSession session = req.getSession();
		session.setAttribute("depts", depts);
//		req.getRequestDispatcher("../overtime.jsp").forward(req, resp);
	}
}
